<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>天空电影设置</title>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css?v=1024">
    <link rel="stylesheet" href="__STATIC__/css/admin_style.css?v=1024">
    <script type="text/javascript" src="__STATIC__/js/jquery.js?v=1024"></script>
    <script type="text/javascript" src="__STATIC__/layui/layui.js?v=1024"></script>
    <script>
        
    </script>
    <style type="text/css">
        label.layui-form-label {
            width: calc(100% - 40px);
            margin: 10px;
            padding: 0 10px;
            text-align: left;
        }
        .layui-input-block {
            margin-left: 10px !important;
            min-height: 36px;
            margin-right: 10px;
        }
        .tiantangzhanshi {
            display: flex;
            justify-content: space-around;
            align-items: center;
            margin: 10px;
            color: #999;
            font-size: 12px;
            flex-wrap: wrap;
        }
        .tiantangzhanshi div {
            width: 50%;
            margin: 5px 0px;
        }
        .tiantangzhanshi input {
            border: 1px solid #ccc;
            border-radius: 3px;
            padding: 3px 5px;
            background: #eee;
        }
    </style>
</head>
<body>
    
<form  class="layui-form layui-form-pane" method="post" action="">
     <div class="tiantangzhanshi" style="">
         <div>本地ID：<input id="vod_id" name="vod_id" type="text" readonly="true" value="{$vod_id}"></div>
         <div>本地名：<input id="vod_name" name="vod_name" type="text" readonly="true" value="{$vod_name}"></div>
         <div>天堂ID：<input id="tiantang_id" name="tiantang_id" readonly="true" type="text" value="{$tiantang_id}"></div>
         <div>天堂名：[点击输入框复制]<input id="tiantang_name" name="tiantang_name" readonly="true" type="text" value=""></div>
     </div>
     <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
          <legend>输入链接</legend>
        </fieldset>
        <div class="layui-input-block">
            <textarea name="url" id="url" placeholder="请输入链接" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
          <legend>输入key</legend>
        </fieldset>
        <div class="layui-input-block">
            <textarea name="key" id="key" value="1" placeholder="请输入key" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
          <legend>是否连载</legend>
        </fieldset>
        <div class="layui-input-block">
          <input type="radio" name="islianzai" lay-filter="islianzai" value="1" title="是" checked="true">
          <input type="radio" name="islianzai" lay-filter="islianzai" value="0" title="否">
        </div>
      </div>
      
      <div class="layui-form-item">
        <div class="layui-input-block" style="text-align: center; margin-top: 20px;">
        <button type="submit" class="layui-btn" lay-submit="" refresh="no" lay-filter="formSubmit" data-child="true">保 存</button>
        </div>
      </div>
</form>
{include file="../../../application/admin/view/public/foot" /}
<script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.6/clipboard.min.js"></script>
<script>
  var form, layer;
  layui.use(['form', 'layedit', 'laydate'], function(){
      form = layui.form
      ,layer = layui.layer;
      $("#key").val('1')
      form.on('radio(islianzai)', function (data) { 
        if(data.value == 0) {
            $("#key").val('急速')
        } else {
            $("#key").val(1)
        }
        form.render();
      });
      
        var clipboard = new ClipboardJS('#tiantang_name', {
            text: function () {
                var name = $("#tiantang_name").val();
                return name;
            }
        });
    
        clipboard.on('success', function (e) {
            layer.msg('复制成功');
        });
    
        clipboard.on('error', function (e) {
            
        });
        
        $.get("https://ss.lcjlnjyy.com:11011/system/api/video/detail/{$tiantang_id}?categoryId=10000%2C2%2C115%2C152&channel=meijupingios&idfa=1CA49709-B459-468E-AA98-352A17DAE4F2&ifrom=ios&packageName=com.meijuniao.app&userId=0&version=2.2.3", function(res) {
            $("#tiantang_name").val(res.data.name);
        }, "json");
  });
  $("#url").change(function() {
      $(this).val(decodeURIComponent($(this).val()));
  });
  
  function onSubmitResult(res) {
      layer.open({type:2, title:"{$vod_name}-数据更新", content:"{:url('/tiantang/fixedkongurl/vodId/'.$vod_id)}", area: ['85%', '80%'], cancel: function () {
                parent.location.reload();
                parent.layer.closeAll();
                layer.closeAll();
            }});
  }
  
</script>
</body>
</html>